import { h } from 'vue';
import { AdColumn } from '@/components/AdTable';
import { expandAndToString } from '@/utils/common';
import { BasicUpload } from '@/components/Upload';
import { TableImg } from '@/components/Table';
import { ImageSelector } from '@/components/ImageSelector';
import { List } from '@/components/Linqts';
import { isArray, isNull, isObject, isString } from '@/utils/is';
import FileUpload from '@/components/Form/src/components/FileUpload.vue';
import { debug } from 'console';
import { AjaxResult } from '@/api/model';
import { GetWareHouseTreeNodes } from '@/views/wms/warehouses/warehouse/warehouse.api';

export const columns: AdColumn[] = [
  {
    title: '主键',
    dataIndex: 'Id',
    dataType: 'guid',
    width: 300,
    defaultHidden: true,
    filterable: false,
    sorter: true,
    formVisible: true,
    formEditable: false,
  },
  {
    title: '仓库名称',
    dataIndex: 'WareHouseName',
    dataType: 'string',
    width: 150,
    filterable: false,
    sorter: false,
  },
  {
    title: '库区名称',
    dataIndex: 'WareHouseAreaName',
    dataType: 'string',
    width: 150,
    filterable: false,
    sorter: false,
  },
  {
    title: '库位名称',
    dataIndex: 'WareHouseAreaPosName',
    dataType: 'string',
    width: 150,
    filterable: false,
    sorter: false,
  },
  {
    title: '库位',
    dataIndex: 'WareHouseAreaPosId',
    dataType: 'guid',
    width: 150,
    defaultHidden: true,
    filterable: true,
    sorter: false,
    editComponent: 'ApiTreeSelect',
    editComponentProps: {
      api: async () => {
        const result: AjaxResult = await GetWareHouseTreeNodes();
        return result.Data;
      },
      resultField: 'Data',
      labelField: 'Name',
      valueField: 'Id',
      childrenField: 'Children',
      treeNodeFilterProp: 'Name',
      onChange: (e, arr) => {
        console.log(e);
      },
    },
  },
  {
    title: 'IPN',
    dataIndex: 'IPNNo',
    dataType: 'string',
    width: 150,
    filterable: false,
    sorter: false,
  },
  {
    title: '名称',
    dataIndex: 'IPNName',
    dataType: 'string',
    width: 150,
    filterable: false,
    sorter: false,
  },
  {
    title: '库存数量',
    dataIndex: 'IPNNum',
    dataType: 'number',
    width: 150,
    filterable: false,
    sorter: false,
    align: 'center',
  },
];

export interface InputDto {}

export interface OutputDto {}
